package com.gite.nouette.admin.implementation.data;

import com.gite.nouette.admin.contract.data.IJsonRpcResponse;
import com.gite.nouette.admin.contract.service.IVisitorData;

public class JsonRpcResponse<R> implements IJsonRpcResponse<R> {
	private String jsonrpc;
	private R result;
	private String error;
	private String id;

	public JsonRpcResponse() {
	}

	public JsonRpcResponse(String jsonrpc, R result, String error, String id) {
		setJsonrpc(jsonrpc);
		setResult(result);
		setError(error);
		setId(id);
	}

	@Override
	public String getJsonrpc() {
		return jsonrpc;
	}

	@Override
	public void setJsonrpc(String jsonrpc) {
		this.jsonrpc = jsonrpc;
	}

	@Override
	public R getResult() {
		return result;
	}

	@Override
	public void setResult(R result) {
		this.result = result;
	}

	@Override
	public String getError() {
		return error;
	}

	@Override
	public void setError(String error) {
		this.error = error;
	}

	@Override
	public String getId() {
		return id;
	}

	@Override
	public void setId(String id) {
		this.id = id;
	}

	@Override
	public void accept(IVisitorData visitor) {
		visitor.visitJsonRpcResponse(this);
	}
}
